<?php

namespace app\api\model;

use think\Model;
use traits\model\SoftDelete;

class Classes extends Model
{
    use SoftDelete;
    protected $deleteTime = 'deletetime';
    protected $hidden = ['is_show', 'deletetime', 'createtime', 'updatetime', 'pivot'];

    public function students()
    {
        return $this->hasMany(Students::class, 'class_id', 'id');
    }

    public static function getClassesbyId($ids)
    {
        return self::whereIn('id', $ids)->select();
    }
}
